home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15093 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: dispatch.news.demon.net!demon!pcf.spectratek.co.uk
  2. From: Dean Darlison <dean_darlison@spectratek.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Check if a file exists?
  5. Date: Wed, 17 Apr 1996 07:50:26 -0700
  6. Organization: Spectra-Tek UK Ltd
  7. Message-ID: <31750532.318@spectratek.co.uk>
  8. References: <4kp7pg$upe@news-s01.ny.us.ibm.net> <317261E6.31D0@spectratek.co.uk> <829569968snz@genesis.demon.co.uk> <3172B2E8.7D70@willows.com>
  9. NNTP-Posting-Host: pcf.spectratek.co.uk
  10. X-NNTP-Posting-Host: pcf.spectratek.co.uk
  11. X-Mailer: Mozilla 2.0 (Win16; I)
  12. MIME-Version: 1.0
  13. Content-Type: text/plain; charset=us-ascii
  14. Content-Transfer-Encoding: 7bit
  15.  
  16. Tarang Deshpande wrote:
  17. > Lawrence Kirby wrote:
  18. > >
  19. > > In article <317261E6.31D0@spectratek.co.uk>
  20. > >            dean_darlison@spectratek.co.uk "Dean Darlison" writes:
  21. > >
  22. > > >man access
  23. > >
  24. > > If that works on your system then the contents should tell you that this
  25. > > function is inappropriate for the question asked.
  26. > >
  27. > > --
  28. > > -----------------------------------------
  29. > > Lawrence Kirby | fred@genesis.demon.co.uk
  30. > > Wilts, England | 70734.126@compuserve.com
  31. > > -----------------------------------------
  32. > Under SUNOS 5.4, LINUX 1.1.46 and conforming to SVID, AT&T, POSIX,
  33. > X/OPEN, and BSD 4.3
  34. > #include <unistd.h>
  35. > int access (const char *path, int amode)
  36. > where amode is F_OK then the function is used to test for existance.
  37.  
  38. I beg to differ. To determine if a file exists without usinf fopen.
  39.  
  40. from man access:
  41. int access(const char *path, int access_mode);
  42.  
  43. with an access mode of 0 (zero). This just checks for the existance of 
  44. the file specified.
  45.  
  46. Cheers,
  47.    Dean.
  48. -- 
  49. Dean.A.Darlison        
  50. Spectra-Tek UK Ltd
  51. email:    dean_darlison@spectratek.co.uk
  52. Tel:    01653-695551
  53.